1. Field of the Invention
The present invention relates to database management systems. More specifically, the present invention relates to a method and an apparatus for facilitating a database query using a query criteria template.
2. Related Art
The effectiveness of a database search largely depends on the quality of the search criteria entered by the user. Typically, a database application's user interface (UI) allows the user to enter values for a number of search fields to facilitate rapid identification of specific data records. However, this manual input process of these search-field values can be tedious and inefficient, especially if a user regularly conducts similar searches.
One approach to alleviate this problem is to allow users to create query criteria templates. Conventionally, query criteria templates are created using multiple tables. However, this multi-table structure can be inefficient and difficult to scale. For example, a query criteria template is typically implemented using a master-child table structure. A master table may contain a number of records, each record storing general header information of a query criteria template, such as template name and creation time. Every record in the master table is also associated with a child table, which contains names and values of search fields of a particular query criteria template. A child table stores the name and value of each field as a record, therefore a set of search criteria may require a large number of records. This can occupy a lot of storage space. In addition, a large number of templates can result in the added burden of managing the master table and the child tables, because reconstruction of a set of query criteria requires joining of a record in the master table with the records in a child table.
Hence, what is needed is a method and an apparatus for efficiently facilitating database queries using query criteria templates without storing the templates in multiple tables.